package com.zz.fileoperatelib.loadmanager;

import android.os.Bundle;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

import com.zz.fileoperatelib.R;

import java.util.List;

public class LoaderActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_loader);

        TextView textview = findViewById(R.id.textview);

        new LoadLocalPhoto(this).setLoadFinishCallback(new LoadLocalPhoto.LoadFinishCallback() {
            @Override
            public void finish(List<ImageFolder> folderList) {
                //获取到文件数据就可用进行一系列操，比如给listview设置adapter
                String str = "通过loadmanager查询图片文件夹结果：\n";
                for (ImageFolder imageFolder : folderList) {
                    str += "图片文件夹：" + imageFolder.name + "\n" + "地址：" + imageFolder.path + "\n";
                    System.out.println(imageFolder.name + "  " + imageFolder.path);
                }
                textview.setText(str);
            }
        });
    }

}
